﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="P_PartOrder.aspx.cs" MasterPageFile="~/Popup.Master"
    Inherits="SAP.P_PartOrder" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" src="../../js/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="../../js/main.js"></script>
    <link href="../../skin/skin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function RefreshUpdatePanel() {

        };

        function PopupPrint() {
            <%Session["DocumentType"] = "PO"; %> 
            var url = "rptViewer.aspx?type=PO&GeneralID=" + document.getElementById('hf_GeneralID').value;
            window.open(url, '_self');
        };

    </script>
    <div>
        <asp:UpdatePanel ID="editItemUpdatePanel" runat="server" UpdateMode="Conditional"
            ChildrenAsTriggers="True">
            <ContentTemplate>
                <span class="style1">Part Order:</span><br />
                <table border="0" width="100%">
                    <tr>
                        <td style="width: 50%">
                            <table border="0" width="100%" style="background-color: #C9DBF2;">
                                <tr>
                                    <td style="width: 15%"  class="FormLineItemAlt">
                                        Date/ PO. No.
                                    </td>
                                    <td style="width: 35%" class="FormLineItemAlt">
                                        <asp:TextBox ID="txtDate" runat="server" Enabled="False" Width="45%"></asp:TextBox>
                                        <asp:TextBox ID="txt_PONo" runat="server" Enabled="False" Width="45%"></asp:TextBox>
                                    </td>
                                    <td style="width: 15%" class="FormLineItemAlt">
                                        &nbsp;
                                    </td>
                                    <td style="width: 35%" class="FormLineItemAlt">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 15%" class="FormLineItemAlt">
                                        VIN/ Name
                                    </td>
                                    <td style="width: 35%" class="FormLineItemAlt">
                                        <asp:TextBox ID="txt_VIN" runat="server" Width="45%" Enabled="False"></asp:TextBox>
                                        <asp:TextBox ID="txt_VehicleName" runat="server" Enabled="False" Width="45%"></asp:TextBox>
                                    </td>
                                    <td style="width: 15%" class="FormLineItemAlt">
                                        Customer Name
                                    </td>
                                    <td style="width: 35%" class="FormLineItemAlt">
                                        <asp:TextBox ID="txt_CusName" runat="server" Width="90%" Enabled="False"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 15%" class="FormLineItemAlt">
                                        Brand
                                    </td>
                                    <td style="width: 35%" class="FormLineItemAlt">
                                        <asp:TextBox ID="txt_Brand" runat="server" Width="90%" Enabled="False"></asp:TextBox>
                                    </td>
                                    <td style="width: 15%" class="FormLineItemAlt">
                                        Address
                                    </td>
                                    <td style="width: 35%" class="FormLineItemAlt">
                                        <asp:TextBox ID="txt_Address" runat="server" Enabled="False" Width="90%"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 15%" class="FormLineItemAlt">
                                        Engine No./ Reg No.
                                    </td>
                                    <td style="width: 35%" class="FormLineItemAlt">
                                        <asp:TextBox ID="txt_EngineNo" runat="server" Enabled="False" Width="45%"></asp:TextBox>
                                        <asp:TextBox ID="txt_RegNo" runat="server" Enabled="False" Width="45%"></asp:TextBox>
                                    </td>
                                    <td style="width: 15%" class="FormLineItemAlt">
                                        Contact Person
                                    </td>
                                    <td style="width: 35%" class="FormLineItemAlt">
                                        <asp:TextBox ID="txt_ContactPerson" runat="server" ClientIDMode="Static" Enabled="False"
                                            Width="50%"></asp:TextBox>
                                        <asp:TextBox ID="txt_PhoneContact" runat="server" ClientIDMode="Static" Enabled="False"
                                            Width="40%"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <table border="0" width="100%">
                    <tr>
                        <td>
                            <asp:Button ID="btn_Cancel" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                Height="30px" OnClientClick="return Main.cancelDialogClick()" Text="Close" Width="90px" />
                            <asp:Button ID="btn_Print" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                Height="30px" Text="Print" Width="90px" OnClientClick="PopupPrint();" />
                            <asp:HiddenField ID="hf_GeneralID" runat="server" ClientIDMode="Static" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lb_Message" runat="server" Text="PARTS" Font-Bold="True"></asp:Label>
                            :
                        </td>
                    </tr>
                </table>
                <table border="0" width="100%" style="background-color: #D1D4D8;">
                    <asp:GridView ID="grvPO" CssClass="GridInner" runat="server" Width="100%" BorderColor="White"
                        BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                        HeaderStyle-Height="27px" CellSpacing="2" HeaderStyle-VerticalAlign="Middle"
                        AllowPaging="True" PageSize="20">
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                        <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px" />
                        <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                        <Columns>
                            <asp:TemplateField HeaderText="#">
                                <ItemStyle HorizontalAlign="Center" Width="20px" />
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemTemplate>
                                    <asp:Label ID="lblNo" runat="server" Text='<%# Eval("RowNum") %>' BorderStyle="none">
                                    </asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Part NBR">
                                <ItemStyle HorizontalAlign="Left" Width="100px" />
                                <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                <ItemTemplate>
                                    <asp:Label ID="lblItemCode" runat="server" Text='<%# String.Format("{0,-15:#,##0.00}", Eval("ItemCode")) %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Part Name">
                                <ItemStyle HorizontalAlign="Left" Width="250px" />
                                <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                <ItemTemplate>
                                    <asp:Label ID="lblItemName" runat="server" Text='<%# String.Format("{0,-15:#,##0.00}", Eval("ItemName")) %>'
                                        BorderStyle="none" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="VN Name">
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Left" Width="250px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbFrgnName" runat="server" Text='<%# String.Format("{0,-15:#,##0.00}", Eval("FrgnName")) %>'
                                        BorderStyle="none" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Quantity">
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Right" Width="50px" />
                                <ItemTemplate>
                                    <asp:Label ID="txtQty" runat="server" Width="97%" Text='<%# String.Format("{0,-15:#,##0.00}", Eval("Quantity")) %>'
                                        AutoPostBack="true" Style="text-align: right" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Stock">
                                <ItemStyle HorizontalAlign="Right" />
                                <HeaderStyle VerticalAlign="Middle" Width="50px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbStock" runat="server" Text='<%# String.Format("{0,-15:#,##0.00}", Eval("Stock")) %>'
                                        BorderStyle="none" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False"
                            Height="27px" VerticalAlign="Bottom" />
                        <EmptyDataTemplate>
                            <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all"
                                cellspacing="2" cellpadding="2">
                                <tr valign="middle" style="height: 27px; color: white; font-weight: bold; text-decoration: none;
                                    background-color: rgb(96, 149, 201);">
                                    <th>
                                        <span>Action</span>
                                    </th>
                                    <th>
                                        <span>#</span>
                                    </th>
                                    <th>
                                        <span>Part NBR</span>
                                    </th>
                                    <th>
                                        <span>Part Name</span>
                                    </th>
                                    <th>
                                        <span>VN Name</span>
                                    </th>
                                    <th>
                                        <span>Quantity</span>
                                    </th>
                                    <th>
                                        <span>P. Stock</span>
                                    </th>
                                </tr>
                                <tr>
                                    <td colspan="9">
                                        <span>No Data</span>
                                    </td>
                                </tr>
                            </table>
                        </EmptyDataTemplate>
                    </asp:GridView>
                </table>
                <%--
            <div ID="action-form">
               <asp:ImageButton ID="btnAdd" runat="server" 
                    ImageUrl="~/skin/images/SAP_choose.png" OnClick="btnAdd_Click" />
                <asp:ImageButton ID="btnCancel" runat="server" 
                    ImageUrl="~/skin/images/SAP_cancel.png" 
                    OnClientClick="return Main.cancelDialogClick()" />
            </div>--%>
            </ContentTemplate>
            <Triggers>
                <%-- <asp:PostBackTrigger  ControlID="btnFilter" />--%>
                <%--  <asp:PostBackTrigger  ControlID="txtFilter" />--%>
            </Triggers>
        </asp:UpdatePanel>
    </div>
</asp:Content>
